Skip to content

Add listNamespaces GraphQL query with namespace git config#1928

Merged
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:namespace-git-info-gql
Mar 26, 2026
Merged

Add listNamespaces GraphQL query with namespace git config#1928
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:namespace-git-info-gql

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Mar 26, 2026

Summary

Namespaces were not queryable via GraphQL at all, and the UI had no reliable way to identify git root namespaces (it was checking deployment source badges rather than actual git configuration).

This PR adds a listNamespaces GraphQL query that returns each namespace with a git: NamespaceGit union field, which is either GitRootConfig (repo, path, defaultBranch) for git root namespaces, or GitBranchConfig (branch, gitOnly, parentNamespace, root) for branch namespaces, or null for non-git namespaces.

The resolver resolves branch configs inline by embedding the root config, so no extra round-trips are needed. The resolution logic in get_git_info_for_namespace is extracted into a sync resolve_git_info_from_map helper to allow future batch/DataLoader usage.

On the UI side, the namespace sidebar now fetches via listNamespacesWithGit (replacing two separate REST calls) and shows a Git badge on namespaces where there is a git root set.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit c2f61a0
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69c554a5d92ce80009518a94

@shangyian shangyian changed the title Namespace git info gql Add listNamespaces GraphQL query with namespace git config Mar 26, 2026
@shangyian shangyian force-pushed the namespace-git-info-gql branch from 642fd4f to c2f61a0 Compare March 26, 2026 15:45
@shangyian shangyian marked this pull request as ready for review March 26, 2026 16:27
@shangyian shangyian merged commit 31b8268 into DataJunction:main Mar 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant